function lazyload(){
    var temp1=window.innerHeight||document.documentElement.clientHeight
    var temp2=document.body.scrollTop||document.documentElement.scrollTop
    var maxshowHeight=temp1+temp2
    var imgSObj=document.querySelectorAll('img')
        imgSObj.forEach(function(item,i){
            if(item.offsetTop<maxshowHeight){
                 item.src=item.getAttribute('src-real')
         }
    })
}
lazyload()  
window.onscroll=lazyload 